<%
    String id = request.getParameter("id");
    if (id != null) {
%>
<h1 class="page-header">List all contents with ID = <%=id%></h1>
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Title</th>
                <th>Category</th>
                <th>Author</th>
                <th>Time</th>
            </tr>
        </thead>
        <tbody>
<%
int n = 0;
try{
    n = Integer.parseInt(id);
}catch(NumberFormatException e){
}
    DAO_News daonews = new DAO_News();
    List<News> newsList = daonews.newsInCat(n);
    for(News news : newsList) {
%>
            <tr data-url="<%=news.getId()%>" class="content-context-menu">
                <td><%=news.getTitle()%></td>
                <td><%=news.getCatname()%></td>
                <td><%=news.getAuthor()%></td>
                <td><%=ConvertUnixTime.normalTime(news.getDateline())%></td>
            </tr>
<%
    }
%>
        </tbody>
    </table>
</div>
<a class="btn btn-primary btn-lg " style="border-radius: 0" href="Dashboard.jsp?view=add-content"><i class="fa fa-plus-square"></i> Add New Content</a>
<%
        
    }
%>